3.39 \(\int \frac{A+B \tan (c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=47 \[ \frac{-B+i A}{2 d (a+i a \tan (c+d x))}+\frac{x (A-i B)}{2 a} \]

[Out]

((A - I*B)*x)/(2*a) + (I*A - B)/(2*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0427031, antiderivative size = 47, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.077, Rules used = {3526, 8} \[ \frac{-B+i A}{2 d (a+i a \tan (c+d x))}+\frac{x (A-i B)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Tan[c + d*x])/(a + I*a*Tan[c + d*x]),x]

[Out]

((A - I*B)*x)/(2*a) + (I*A - B)/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3526

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^m)/(2*a*f*m), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1),
 x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{A+B \tan (c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac{i A-B}{2 d (a+i a \tan (c+d x))}+\frac{(A-i B) \int 1 \, dx}{2 a}\\ &=\frac{(A-i B) x}{2 a}+\frac{i A-B}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [B]  time = 0.452348, size = 102, normalized size = 2.17 \[ \frac{\cos (c+d x) (A+B \tan (c+d x)) ((A (2 d x-i)-2 i B d x+B) \tan (c+d x)-2 i A d x+A+B (-2 d x+i))}{4 a d (\tan (c+d x)-i) (A \cos (c+d x)+B \sin (c+d x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Tan[c + d*x])/(a + I*a*Tan[c + d*x]),x]

[Out]

(Cos[c + d*x]*(A + B*Tan[c + d*x])*(A - (2*I)*A*d*x + B*(I - 2*d*x) + (B - (2*I)*B*d*x + A*(-I + 2*d*x))*Tan[c
 + d*x]))/(4*a*d*(A*Cos[c + d*x] + B*Sin[c + d*x])*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [B]  time = 0.027, size = 121, normalized size = 2.6 \begin{align*}{\frac{A}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{2}}B}{ad \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) A}{ad}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) -i \right ) B}{4\,ad}}+{\frac{B\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{4\,ad}}+{\frac{{\frac{i}{4}}A\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x)

[Out]

1/2/d/a/(tan(d*x+c)-I)*A+1/2*I/d/a/(tan(d*x+c)-I)*B-1/4*I/d/a*ln(tan(d*x+c)-I)*A-1/4/d/a*ln(tan(d*x+c)-I)*B+1/
4/d/a*B*ln(tan(d*x+c)+I)+1/4*I/d/a*A*ln(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.39061, size = 108, normalized size = 2.3 \begin{align*} \frac{{\left (2 \,{\left (A - i \, B\right )} d x e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A - B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(2*(A - I*B)*d*x*e^(2*I*d*x + 2*I*c) + I*A - B)*e^(-2*I*d*x - 2*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 1.43027, size = 88, normalized size = 1.87 \begin{align*} \begin{cases} \frac{\left (i A - B\right ) e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (- \frac{A - i B}{2 a} + \frac{\left (A e^{2 i c} + A - i B e^{2 i c} + i B\right ) e^{- 2 i c}}{2 a}\right ) & \text{otherwise} \end{cases} + \frac{x \left (A - i B\right )}{2 a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise(((I*A - B)*exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*(-(A - I*B)/(2*a) + (A*ex
p(2*I*c) + A - I*B*exp(2*I*c) + I*B)*exp(-2*I*c)/(2*a)), True)) + x*(A - I*B)/(2*a)

________________________________________________________________________________________

Giac [B]  time = 1.42467, size = 115, normalized size = 2.45 \begin{align*} -\frac{\frac{{\left (i \, A + B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac{{\left (-i \, A - B\right )} \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} + \frac{-i \, A \tan \left (d x + c\right ) - B \tan \left (d x + c\right ) - 3 \, A - i \, B}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*((I*A + B)*log(tan(d*x + c) - I)/a + (-I*A - B)*log(-I*tan(d*x + c) + 1)/a + (-I*A*tan(d*x + c) - B*tan(d
*x + c) - 3*A - I*B)/(a*(tan(d*x + c) - I)))/d